/*
 * Splash.java
 *
 * Created on 15 de diciembre de 2008, 16:22
 */

package Vistas;

import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;

/**
 *
 * @author  Juan Manuel Fuentes Diaz
 */
public class Splash extends javax.swing.JFrame implements Runnable{
    private String fs = System.getProperty("file.separator");
    Thread t;
    /** Creates new form Splash */
    public Splash() {
        initComponents();
        this.setLocationRelativeTo(null);
        this.removeNotify();
        this.setUndecorated(true);
        ImageIcon ic=new ImageIcon(System.getProperty("user.dir")+fs+"src"+fs+"Image"+fs+"news.png");
        jLabel1.setIcon(ic);
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 493, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 355, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Thread (new Splash()).start();
            }
        });
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables

    @SuppressWarnings("static-access")
    public void run() {
        try {
            this.setVisible(true);
            t.sleep(5000);
            this.dispose();
            new Idioma().setVisible(true);
        } catch (InterruptedException ex) {
            Logger.getLogger(Splash.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
}
